package com.example.nep.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.example.nep.dto.AdminLoginDTO;
import com.example.nep.model.Admin;
import com.example.nep.dao.AdminMapper;
import com.example.nep.service.IAdminService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author han
 * @since 2024-04-12
 */
@Service
public class AdminServiceImpl extends ServiceImpl<AdminMapper, Admin> implements IAdminService {
    @Override
    public Admin login(AdminLoginDTO loginDTO) {
        LambdaQueryWrapper<Admin> wrapper=new LambdaQueryWrapper<>();
        wrapper.eq(Admin::getAdminCode,loginDTO.getAdminCode())
                .eq(Admin::getPassword,loginDTO.getPassword());
        return getOne(wrapper);
    }
}
